<?php
/**
 * Created by PhpStorm.
 * User: gaocheng
 * Date: 2016/11/28
 * Time: 19:46
 */
var_dump($_REQUEST);
var_dump($_FILES);
$ret=[
    'err'=>0,
    'exinfo'=>$_POST['exinfo'],
];

//testerrr
$ret['err']=1;
$ret['emsg']='test error msg';


move_uploaded_file($_FILES["file"]["tmp_name"], "../upload/". $_FILES["file"]["name"]);

//test success;
$ret['err']=0;
$ret['msg']="传成功了";
$ret['val']='/upload/'.$_FILES['file']['name'];

$jstr="<script type='text/javascript'>
    var upfo=window.top.window.upf;
    upfo.retdata=".json_encode($ret,JSON_UNESCAPED_UNICODE)."
    window.top.window.upf.cbfunc();
    </script>";
echo $jstr;